package com.bwie.config;

import org.aspectj.weaver.ast.Var;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Configuration
public class MyThreaPool {

    @Bean
    public ThreadPoolExecutor threadPoolExecutor (){
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(24, 48, 0L, TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<Runnable>(),
                Executors.defaultThreadFactory()
        );
        return threadPoolExecutor;
    }
}
